Skip to main content

API Test Generation

You can create and manage API tests directly from the chat. Each action uses a specific API Tests - … agent. You tick the agent in Studio, then describe what you want in plain language.

info

The API Tests - … agents are installed by your administrator. To check, open Build → Agent Builder and search for API Test: each agent should show Live. If they are missing, see Ask your administrator for the agents.

What you can do from chat​

ActionAgent to tick in StudioExample prompt
Generate new test cases from a scenarioAPI Tests - Generate testsWrite tests for <operation name>: <valid input> should succeed, and a missing <field> must be rejected.
Change a draft collection or caseAPI Tests - Edit draftChange the <field> in the <case id> body to <value>
Run a collection or a caseAPI Tests - Run testsRun the <collection name> collection
Find out why a case failedAPI Tests - Explain failureWhy did <case id> fail?
Drive a case from a datasetAPI Tests - Map datasetUse <dataset name> for <case id>
Ask about what is set upAPI Tests - AnswerWhich datasets does <collection name> use?
Environments and external sourcesAPI Tests - Shared recordsChange the base URL of <environment name>

Replace the placeholders in angle brackets with names from your own collection. The full list of agents, with what each one can and cannot do, is in The 8 API Test agents.

Before you start​

Generating tests needs more than the agent:

  1. An environment and a collection in API Test. See the Quick start.
  2. Your API definition (OpenAPI, WSDL or Postman) as a Source document, submitted to the collection with Submit to API test. See Submit to API test.
  3. For running tests, a published collection.

How to use it​

  1. Open Studio in the left panel and search for api.
  2. Tick the agent for the job, for example API Tests - Generate tests. You can also tick your collection under API TESTS as extra context. See Studio.
  3. Check that the chat box shows a chip such as 1 Studios. Without it, the chat uses only the general model and cannot create tests.
  4. Start a new chat, describe what you want and send it.
  5. Review the result. Generated tests wait in the collection's Generated tab until you add them.

The usual chat actions, such as exporting the conversation or downloading its log, work on these chats like any other.

For every step in detail, screens, more prompts and troubleshooting, see Generate tests with chat in the API Test Guide.

tip

Looking for test cases in a table, from a requirement document? That is a different feature. See Agent Test Case Format.